const error = {
  state: {
    timeout: 6000,
    message: '',
    visible: false
  },
  mutations: {
    SET_TIMEOUT: (state, timeout) => {
      state.timeout = timeout
    },
    SET_ERROR_MESSAGE: (state, errorMessage) => {
      state.message = errorMessage
    },
    SET_VISIBLE: (state, visible) => {
      state.visible = visible
    }
  },
  actions: {
    setTimeout ({ commit }, timeout) {
      commit('SET_TIMEOUT', timeout)
    },
    setErrorMessage ({ commit }, errorMessage) {
      commit('SET_ERROR_MESSAGE', errorMessage)
    },
    setVisible ({ commit }, visible) {
      commit('SET_VISIBLE', visible)
    }
  }
}
export default error
